Micron Document
🎖️GitЯра🎖️


Displaying Raw • Download

feature/messaging/src/commonMain/kotlin/org/meshtastic/feature/messaging/component/MessageBubble.kt 1390a3cd4f7bc55a37433d1d868e65c01678eb31 (1390a3cd) Text, 2.07 KB

T8b949e/*
* Copyright (c) 2025-2026 Meshtastic LLC
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
Tff7b72package T7ee787org.meshtastic.feature.messaging.component

Tff7b72import T7ee787androidx.compose.foundation.shape.CornerBasedShape
Tff7b72import T7ee787androidx.compose.foundation.shape.RoundedCornerShape
Tff7b72import T7ee787androidx.compose.ui.unit.Dp
Tff7b72import T7ee787androidx.compose.ui.unit.dp

T8b949e/**
* Returns a [CornerBasedShape] for a message bubble based on its position in a sequence.
*
* @param cornerRadius The base corner radius for the bubble.
* @param isSender Whether the message was sent by the local user.
* @param hasSamePrev Whether the previous message in the list is from the same sender.
* @param hasSameNext Whether the next message in the list is from the same sender.
*/
Tff7b72fun Td2a8ffgetMessageBubbleShapeTb4b4b4(
Te6edf3cornerRadiusTb4b4b4: Te6edf3DpTb4b4b4,
Te6edf3isSenderTb4b4b4: Tffa657BooleanTb4b4b4,
Te6edf3hasSamePrevTb4b4b4: Tffa657Boolean Tff7b72= Tff7b72falseTb4b4b4,
Te6edf3hasSameNextTb4b4b4: Tffa657Boolean Tff7b72= Tff7b72falseTb4b4b4,
Tb4b4b4)Tb4b4b4: Te6edf3CornerBasedShape Tb4b4b4{
Tff7b72val Te6edf3square Tff7b72= T79c0ff0.Te6edf3dp
Tff7b72val Te6edf3round Tff7b72= Te6edf3cornerRadius

Tff7b72return Tff7b72if Tb4b4b4(Te6edf3isSenderTb4b4b4) Tb4b4b4{
T8b949e// Sent messages are on the right.
Te6edf3RoundedCornerShapeTb4b4b4(
Te6edf3topStart Tff7b72= Te6edf3roundTb4b4b4,
Te6edf3topEnd Tff7b72= Tff7b72if Tb4b4b4(Te6edf3hasSamePrevTb4b4b4) Te6edf3square Tff7b72else Te6edf3roundTb4b4b4,
Te6edf3bottomStart Tff7b72= Te6edf3roundTb4b4b4,
Te6edf3bottomEnd Tff7b72= Te6edf3squareTb4b4b4,
Tb4b4b4)
Tb4b4b4} Tff7b72else Tb4b4b4{
T8b949e// Received messages are on the left.
Te6edf3RoundedCornerShapeTb4b4b4(
Te6edf3topStart Tff7b72= Te6edf3squareTb4b4b4,
Te6edf3topEnd Tff7b72= Te6edf3roundTb4b4b4,
Te6edf3bottomStart Tff7b72= Tff7b72if Tb4b4b4(Te6edf3hasSameNextTb4b4b4) Te6edf3square Tff7b72else Te6edf3roundTb4b4b4,
Te6edf3bottomEnd Tff7b72= Te6edf3roundTb4b4b4,
Tb4b4b4)
Tb4b4b4}
Tb4b4b4}

Served by rngit 1.5.0 - Generated in 0.14s